package com.adcc.soundalarm.manager;

import com.adcc.soundalarm.config.regular.BGSFactory;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;

import java.util.List;
import java.util.Map;

/**
 * Created by zhangdawei on 2017/3/9.
 * 规则配置管理器-管理所有配置状态
 */
public class RegularConfigManager {

    //构造方法私有化
    private RegularConfigManager(){}

    /**
     * 静态内部类
     */
    private static class LazyHolder{
        private static final RegularConfigManager INSTANCE = new RegularConfigManager();
    }

    /**
     * 单例方法
     * */
    public synchronized static RegularConfigManager getInstance() {
        return LazyHolder.INSTANCE;
    }

    // amqs 状态管理
    private String amqs ;

    // mq 状态管理
    private String mqState ;


    // gw 状态管理
    private String gw;

    // 用户是否同步
    private String autoSysnc ;

    // 日志内容匹配管理
    private List<String> log = Lists.newArrayList();


    /**
     * AMQS 状态设置
     * @param state
     */
    public void setAmqsState(String state) {
        this.amqs = state;
    }

    /**
     * MQ 状态设置
     * @param state
     */
    public void setMqState(String state) {
        this.mqState = state;
    }

    /**
     * GW 状态设置
     * @param state
     */
    public void setGwState(String state) {
        this.gw = state;
    }


    public void setAutoSysnc(String autoSysnc) {
        this.autoSysnc = autoSysnc;
    }

    public void setLogContent(String logContent){
        this.log.add(logContent);
    }


    public String getAmqs() {
        return amqs;
    }

    public String getMqState() {
        return mqState;
    }

    public String getGw() {
        return gw;
    }

    public String getAutoSysnc() {
        return autoSysnc;
    }

    public List<String> getLog() {
        return log;
    }

}
